package masterjava.common.configuration.store;

import masterjava.common.util.MasterProperties;

import java.util.Iterator;
import java.util.Properties;

/**
 * MasterJava.ru
 * <p/>
 * User: GKislin
 * Date: 02.03.11
 *
 * @see java.util.Properties based configuration
 */
public class ResourcePropertiesStore extends AbstractPropertiesStore {

    protected final Properties properties;

    public ResourcePropertiesStore(String fileName) {
        properties = new MasterProperties(fileName);
    }

    @Override
    public String getProperty(String key) {
        return properties.getProperty(key);
    }

    @Override
    public void setProperty(String key, String newValue) {
        properties.setProperty(key, newValue);
    }

    @Override
    public Iterator<String> getKeysIterator() {
        Iterator iterator = properties.keySet().iterator();
        return (Iterator<String>) iterator;
    }
}
